<?php


namespace Trawind\Basics\Requests;


trait NullableField
{


    protected function transform($key, $value)
    {
        if(is_string($value) && !in_array($key, static::nullableField(), true)) {
            $value = $value === '' ? null : $value;
        }

        return $value;
    }



    protected static function nullableField(): array
    {
        return [];
    }
}